import { Base } from '../utils/base.js';

class Order extends Base {
    constructor() {
        super();
    }
	
	//下单预览
	preview(data,callback){
		var params = {
		    url: 'order/preview',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	create(data,callback){
		var params = {
		    url: 'order/create',
		    type: 'post',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//运费
	get_freight(data,callback){
		var params = {
		    url: 'order/getFreight',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//订单列表
	get_order_list(data,callback){
		var params = {
		    url: 'order/getList',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//再次支付
	pay_again(data,callback){
		var params = {
		    url: 'order/payAgain',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//详情
	get_detail(data,callback){
		var params = {
		    url: 'order/detail',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//售后订单详情
	get_after_detail(data,callback){
		var params = {
		    url: 'order/afterOrderDetail',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//取消订单
	cancel_order(data,callback){
		var params = {
		    url: 'order/cancel',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//订单申请售后
	aftersale_order(data,callback){
		var params = {
		    url: 'order/AftersaleOrder',
		    type: 'post',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//物流
	express(data,callback){
		var params = {
		    url: 'order/express',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//确认收货
	confirm_order(data,callback){
		var params = {
		    url: 'order/confirmOrder',
		    type: 'get',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
	//售后快递单填写
	after_express_add(data,callback){
		var params = {
		    url: 'order/afterExpressAdd',
		    type: 'post',
		    loading: true,
			data:data
		};
		this.apiRequest(params, callback);
	}
}

export { Order };
